home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12864 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  52 lines

  1. Path: news.uh.edu!mwk!hossain
  2. From: hossain@mwk.com
  3. Newsgroups: comp.lang.c++
  4. Subject: Simple Question for the GURUs....
  5. Message-ID: <1996Mar21.093000.3545@mwk.com>
  6. Date: 21 Mar 96 09:30:00 CST
  7. Organization: M. W. Kellogg, Houston TX
  8.  
  9. *** A stupid question for the GURUS ***
  10.  
  11. I have a very simple problem. Should the following code work ?
  12.  
  13. //File:myapp.c
  14.  
  15.         char *main(int argc, char *argv[])
  16.         {
  17.            char *temp = (char *)NULL;
  18.  
  19.            temp = (char *)malloc(40 * sizeof(char) );
  20.  
  21.            if ( temp ) strcpy(temp,"Hello World..!!");
  22.  
  23.            return(temp);
  24.         }
  25.  
  26.  
  27. My intent is to have my myapp.exe return to me a string as it should do.
  28.  
  29.  
  30. The next part of my problem is I am setting a variable say ALPHA to the string
  31. coming out of this executable. I am doing this in a PERL script as follows:
  32.  
  33. //File: myperl.cmd
  34. ..............
  35. ............
  36.         @GREETINGS = `myapp.exe`;
  37.         print "Greetings from the Master : @GREETINGS\n";
  38. ...........
  39. ..........
  40.  
  41.  
  42. I am doing this in Windows NT environment.The PERL script appear to hang at the
  43. line @GREETINGS = `myapp.exe`. What is the problem.
  44.  
  45. I will appreciate a response from anyone, who can help solve this apparently
  46. simple problem. Please e-mail me directly at "hossain@mwk.com".
  47.  
  48. Hoping to hear from someone there.
  49.  
  50. thanks
  51. akhtar 
  52.